//
// Created by jyh on 2021/8/1.
//

#ifndef BBOVRSCHIP_ANTATX_H
#define BBOVRSCHIP_ANTATX_H

#include "./Const.h"

//#include "../Com/Com.h"

typedef struct Antatx {
    int nfreq;
    char freq[MAXSYS][MAXFREQ][LEN_FREQ];
    char antnam[LEN_ANTENNA];
    char antnum[LEN_ANTENNA];
    double zen1;
    double zen2;
    double dzen;
    double dazi;
    double neu[MAXSYS][MAXFREQ][3];   // PCO
    double pcv[MAXSYS][MAXFREQ][2][2];  // MAXFREQ ROW(81) COL(30), here minish it to save storage since we don't need it.
};

void Antatx_m_resetMem(struct Antatx* AX);
int Antatx_m_getAnt(struct Antatx* AX, const char* ctype, int* nfreq, char freq[MAXSYS][MAXFREQ][LEN_FREQ],
                    double fjd_beg, double fjd_end, const char* antnam, const char* antnum,
                    double enu_sat[MAXFREQ][3],double enu_sit[MAXSYS][MAXFREQ][3]);
void Antatx_s_checkdata(char* line,char* format);
int Antatx_s_rdSvnav(const char* cprn,double mjd,char* blk,double* mass,int* ifreq,double* xyz,char* sid,char* svn);
int Antatx_s_antnam(const char* sitname, const char* anttyp, char* antname);
int Antatx_m_rdatx(struct Antatx* AX, int nfreq[MAXSYS], char freq[MAXSYS][MAXFREQ][LEN_FREQ], double fjd_beg, double fjd_end);

#endif //BBOVRSCHIP_ANTATX_H
